include ../../Makefile.config

UnstructMG_BUILD_DIR = $(shell pwd)/../../build

all: 	demo-1.exe simu-1.exe simu-3.exe \
		bench-3.exe bench-4.exe generic-1.exe generic-3.exe generic-4.exe

.PHONY: clean

%.exe: %.o
	$(CXX) $^ -o $@ $(DEBUG_OPT) $(LFLAGS) -L$(UnstructMG_BUILD_DIR)/lib -lUnstructmg -Wl,-rpath=$(UnstructMG_BUILD_DIR)/lib $(EXT_LD)

generic-3.o: ../generic-x.cpp
	$(CXX) $^ -c -std=c++17 -Wall -O3 -g -fopenmp -DDOF=3 $(COLM) $(XCLANG) $(INCLUDES) $(DEBUG_OPT) -I$(UnstructMG_BUILD_DIR)/include -I./ -o $@

generic-4.o: ../generic-x.cpp
	$(CXX) $^ -c -std=c++17 -Wall -O3 -g -fopenmp -DDOF=4 $(COLM) $(XCLANG) $(INCLUDES) $(DEBUG_OPT) -I$(UnstructMG_BUILD_DIR)/include -I./ -o $@

%.o : ../%.cpp
	$(CXX) $^ -c -std=c++17 -Wall -O3 -g -fopenmp $(COLM) $(XCLANG) $(INCLUDES) $(DEBUG_OPT) -I$(UnstructMG_BUILD_DIR)/include -I./ -o $@


clean :
	rm *.exe *.o
